package com.example.mapper;

import com.example.dto.Goods;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;
import java.util.Map;

/**
 * <P> @Author: SongKeCheng
 * <P> Type: Class
 * <P> Description:
 * <P> Date: 2024/5/28:15:46
 */

@SuppressWarnings({"unchecked", ""})
public interface GoodsMapper {
    //查询所有
    public List<Goods> allGoods();

    //添加商品
    public int addGoods(Goods goods);

    //更新商品
    public int updateGoods(Goods goods);

    //删除商品
    public int deleteGoods(int id);

    //以id查询
    public Goods findById(int id);

    //以id、author查询
    public Goods findByIdAndAuthor(Goods goods);

    //以author查询
    public Goods findByAuthor(String author);

    //分页查询
    public List<Goods> findByPage(Map<String, Object> map);

    public Goods findByIdAndAuthor2( int id,String author);

    public Goods findGoodsAndCategoryById(int id);

    public List<Goods>findNoOrMore(Goods goods);

    public List<Goods>findNoOrMoreWhere(Goods goods);

    public List<Goods>findByNameOrAuthor(Goods goods);

    public int updateGoodsStatusOr(Map<String, Object> map);

    public int updateGoodsStatusIn(Map<String, Object> map);
}
